#include <stdio.h>


int main(int argc, char *argv[]) {

    int n = 0, pre = -1, flag = 1;
    for (size_t i = 0; i < 6; i++)
    {
        scanf("%d", &n);
        if (n < pre)
        {
            flag = 0;
        }
        pre = n;
    }
    
    if(flag)
        printf("YES");
    else
        printf("NO");

    return 0;
}